<template>
  <div class="recommend-job">
    <div class="title">{{title}}</div>
    <div v-if="message.length !== 0">
      <div class="item" v-for="(item, index) in message" :key="index">
        <div class="top">
          <div class="first">
            <div class="job-name">{{ item.jobName }}</div>
            <div class="job-salary" v-if="item.salaryMeet == 1">薪资面议</div>
            <div class="job-salary" v-else>
              {{ item.salaryRangeFrom }}k - {{ item.salaryRangeTo }}k
            </div>
          </div>
          <div class="second">
            <span>{{ item.jobCity }}</span>
            <span v-if="item.jobRequireEdu === 1">专科及以上</span>
            <span v-else-if="item.jobRequireEdu === 2">本科及以上</span>
            <span v-else-if="item.jobRequireEdu === 3">硕士及以上</span>
            <span v-else>不限</span>
          </div>
        </div>
        <div class="bottom">
          <div class="company">
            <img :src="item.avatar" alt="" />
            <span>{{ item.nickname }}</span>
          </div>
        </div>
      </div>
    </div>
    <!-- <div v-else class="empty">暂无推荐,请完善个人资料</div> -->
    <div v-else class="empty">暂无职位信息</div>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive, toRefs, onMounted,defineProps } from 'vue'
const props = defineProps({
  title:String,
  message:Array
})
</script>
<style scoped>
.recommend-job{
  width: 95%;
  margin-left: 20px;
  border-radius: 10px;
}

.recommend-job .empty{
  height: 50px;
  line-height: 33px;
  color: #333;
  text-align: center;
  background-color: #fff;
}

.recommend-job .title{
    padding: 10px;
    font-size: 20px;
    font-weight: 600;
    line-height: 33px;
    color: #333;
    background-color: #fff;
    border-radius: 5px;
}

.recommend-job .item{
  height: 99px;
  padding: 10px;
  margin-bottom: 10px;
  background-color: #fff;
  border-radius: 5px;
}

.recommend-job .item .top{
  height: 53px;
}

.recommend-job .item .top .first{
  display: flex;
  height: 21px;
  justify-content: space-between;
}

.recommend-job .item .top .first .job-name{
    display: inline-block;
    height: 20px;
    max-width: 200px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommend-job .item .top .first .job-salary{
    font-size: 14px;
    font-weight: 400;
    color: #ea4e07;
    text-align: right;
    flex: auto;
}

.recommend-job .item .top .second{
  height: 28px;
  padding-bottom: 10px;
  margin-top: 3px;
  margin-bottom: 1px;
}

.recommend-job .item .top .second span{
    display: inline-block;
    padding: 0 5px;
    font-size: 12px;
    font-weight: 400;
  color: #bbb;
}

.recommend-job .item .bottom{
  height: 36px;
}

.recommend-job .item .bottom .company{
  display: flex;
  align-items: center;
}

.recommend-job .item .bottom .company img{
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.recommend-job .item .bottom .company span{
    display: inline-block;
    max-width: 250px;
    margin-left: 5px;
    overflow: hidden;
    line-height: 34px;
    color: #333;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: text-top;
}
</style>
